package com.example.exceltosqlite.entity;

import android.os.Build;
import android.support.annotation.RequiresApi;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;
import java.util.Objects;

/**
 * Created by ColorRain on 2021/5/21.
 * 报文类型表
 */

//表名
@DatabaseTable(tableName = "telegramType")
public class SqliteFileTypeEntity implements Serializable {
    @DatabaseField(generatedId = true)
    private int id;
    @DatabaseField(columnName = "type")
    private String type;



    public SqliteFileTypeEntity() {
    }


    public SqliteFileTypeEntity(int id,  String type) {
        this.id = id;
        this.type = type;
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "SqliteFileTypeEntity{" +
                "id=" + id +
                ", type='" + type + '\'' +
                '}';
    }

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SqliteFileTypeEntity that = (SqliteFileTypeEntity) o;
        return Objects.equals(type, that.type);
    }

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public int hashCode() {
        return Objects.hash(type);
    }
}
